import { debounce } from '../../li-ui/utils/lodash'
const _icons = [
  'divider',
  'button',
  'pubuliu',
  'chevron-right',
  'arrow-top',
  'arrow-down',
  'apps',
  'arrow-left',
  'arrow-right',
  'battery',
  'baby',
  'bag',
  'bolt',
  'bank',
  'barcode',
  'bomb',
  'brush',
  'book',
  'bookmark',
  'box',
  'cabinet-login',
  'cabinet-logout',
  'browser',
  'burger',
  'cabinet',
  'calendar',
  'calculator',
  'cart',
  'camera',
  'card',
  'bucket',
  'cart-small',
  'case',
  'cash',
  'chart',
  'clip',
  'castle',
  'catalog',
  'chess',
  'cocktail',
  'cloud-down',
  'coffee',
  'cloud-up',
  'close',
  'clock',
  'clothes',
  'valume-mute',
  'coin',
  'computer',
  'crown',
  'crop',
  'content',
  'cross',
  'compass',
  'cut',
  'cup',
  'diagram',
  'document',
  'dislike',
  'download',
  'delivery',
  'edit',
  'e-mail',
  'earth',
  'diamond',
  'equalizer',
  'eraser',
  'eye',
  'faceid',
  'exchange',
  'filter',
  'flask',
  'folder',
  'gym',
  'globe',
  'grid',
  'headphone',
  'headset',
  'hdd',
  'gamepad',
  'home',
  'inbox',
  'icecream',
  'help',
  'info',
  'flag',
  'invoice',
  'fire',
  'idea',
  'fingerprint',
  'key',
  'keyboard',
  'layers',
  'leaflet',
  'like',
  'laptop',
  'location',
  'link',
  'mail',
  'magnet',
  'lock',
  'medic',
  'megaphone',
  'magicwand',
  'mobile',
  'microphone',
  'minus',
  'message',
  'monocle',
  'moon',
  'medal',
  'microscope',
  'mouse',
  'nameplate',
  'note',
  'notepad',
  'notification',
  'nature',
  'nib',
  'path',
  'paperplane',
  'pen',
  'phone',
  'pin',
  'pause',
  'pizza',
  'pipette',
  'plus',
  'play',
  'question',
  'present',
  'promocode',
  'repost',
  'refresh',
  'print',
  'record',
  'resize-up',
  'resize-down',
  'quote',
  'screen-full',
  'screen-small',
  'share',
  'rules',
  'search',
  'science',
  'shop',
  'shield',
  'sale',
  'settings',
  'safe',
  'rocket',
  'skull',
  'speed',
  'slice',
  'stop',
  'study',
  'stamp',
  'sport',
  'sun',
  'star',
  'target',
  'text',
  'sync',
  'transform',
  'tag',
  'timer',
  'space',
  'turn_on',
  'ufo',
  'trash',
  'user',
  'umbrella',
  'tick',
  'travel',
  'upload',
  'valume',
  'wallet',
  'virus',
  'warehouse',
  'video',
  'webcam',
  'watch',
  'zoom',
  'zoom_plus',
  'warrior',
  'usb',
  'airpods',
  'wifi-off',
  'anchor',
  'alert',
  'alarm-clock',
  'ad',
  'album',
  'wifi-on',
]

Page({
  data: {
    icons: _icons,
  },
  onInput: debounce(
    function (this, { detail: { value } }) {
      this.findIcons(value)
    },
    300,
    {}
  ),
  findIcons(name: string) {
    const icons = _icons.filter((v: string) => v.search(name) !== -1) as []
    this.setData({ icons })
  },
  onShareAppMessage() {},
})
